﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.SqlClient;
using System.Configuration;
using System.Data;
namespace IODataAccess
{
    public sealed class clsDAConnection
    {
        SqlConnection conn = new SqlConnection();
        public static readonly clsDAConnection _Instance = new clsDAConnection();
        public clsDAConnection()
        {
            try
            {
                conn.ConnectionString = ConfigurationManager.ConnectionStrings["ConnectionString"].ToString();
            }
            catch (Exception)
            {

                throw;
            }
        }
        public static clsDAConnection Instance()
        {
            try
            {
                return _Instance;
            }
            catch (Exception)
            {

                throw;
            }
        }
        public SqlConnection getCon()
        {
            try
            {
                return conn;
            }
            catch (Exception)
            {

                throw;
            }
        }
        public void closeCon()
        {
            try
            {
                conn.Close();
            }
            catch (Exception)
            {

                throw;
            }
        }
        public void openCon()
        {
            try
            {
                conn.Open();
            }
            catch (Exception)
            {

                throw;
            }
        }

    }
}
